﻿@if (Request.IsAuthenticated) {
    <text>
        ¡Hola, @Html.ActionLink(User.Identity.Name, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Administrar" })!
        @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) {
            @Html.AntiForgeryToken()
            <a href="javascript:document.getElementById('logoutForm').submit()">Cerrar sesión</a>
        }
    </text>
} else {
    if (ViewBag.autenticado==true){
        <ul>
            <li>@Html.ActionLink("Iniciar sesión", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
        </ul>
    }
    else{

            String var = ViewBag.NombreUsuario;
            //<li>@Html.ActionLink(var, "Contact", "Home")</li>
            //@ViewBag.NombreUsuario
        <ul>
            
            <li>@if (var != null) { @Html.ActionLink(var, "DatosDePerfil", "Usuario"); }
                else{
                    @Html.ActionLink("Contact", "Home");
                }

            <li>@Html.ActionLink("Cerrar sesión", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
        </ul>
    }
}
